package com.xsf.jieyou.business.feign.fallback;

import com.xsf.jieyou.business.common.dto.ResponseResult;
import com.xsf.jieyou.business.common.dto.ResponseStatus;
import com.xsf.jieyou.business.feign.api.ProfileFeign;
import com.xsf.jieyou.commons.utils.MapperUtils;
import org.springframework.stereotype.Component;

/**
 * 个人信息服务熔断器 托底数据。
 * <p>
 * Description:TODO
 * </p>
 *
 * @author xsf
 * @version v1.0.0
 * @date 2019/11/15 0015 16:23
 * @see com.xsf.jieyou.business.feign.fallback
 **/
@Component
public class ProfileFeignFallback implements ProfileFeign {
    /**
     * 获取个人信息
     *
     * @return Json字符串
     */
    @Override
    public String info() {
        try {
            return MapperUtils.obj2json(new ResponseResult<Void>(ResponseStatus.BREAKING.code(),
                    ResponseStatus.BREAKING.message()));
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}
